higher order arrow functions javascript